/**
 * 客户订货系统，属于杭州升鲜宝科技有限公司，由升鲜宝团队开发
 * 主要特点：不同的客户登录，显示不同的商品，不同的商品价格
 * 内置了简易的进销存系统，方便升鲜宝的客户的客户进行简易的出库、入库、盘点、报损、库存查询
 * 升鲜宝供应商管理系统，全套系统授权源代码使用。方便有一定开发能力的公司与团队进行快速的供应链管理系统开发与应用
 * 联系方式：微信 13858022914  
 * 联系人： 余东升
 * 手机号码： 15382353715
 * 
 */
import {
	post,
	get
} from '../utils/request.js'


// 登录
export const loginApi = (data = {}) => {
	return post('/api/login', {
		data,
	})
}

// 认证检查
export const checkAuthentication = (data = {}) => {
	return post('/api/checkAuthentication', {
		data,
		custom: {
			toast: false
		}
	})
}

// 获取验证吗  type 短信类型 1=注册，2=登录，3=修改(忘记)登录密码，4=认证
export const getCodeApi = (data = {}) => {
	return post('/api/getSmsCode', {
		data,
	})
}

// 忘记密码
export const forgetPasswordApi = (data = {}) => {
	return post('/api/forgetPassword', {
		data,
	})
}

// 修改密码
export const resetPasswordApi = (data = {}) => {
	return post('/api/resetPassword', {
		data,
	})
}

// 获取用户信息
export const getShopAccoutInfoApi = (params = {}) => {
	return get('/api/oms/mallshopaccount/getShopAccoutInfo', {
		params,
		custom: {
			toast: false
		}
	})
}

// 刷新token
export const refreshApi = (data = {}) => {
	return post('/api/refresh', {
		data,
	})
}

// 退出登录
export const logout = (data = {}) => {
	return post('/api/logout', {
		data,
	})
}
// 子账号分页接口
export const getShopAccountPageList = (params = {}) => {
	return get('/api/oms/mallshopaccount/page', {
		params,
	})
}
// 客户下面的子帐号列表(选择时使用)
export const getShopAccountList = (params = {}) => {
	return get('/api/oms/mallshopaccount/shopAccountList', {
		params,
	})
}

// 启用禁用子账号
export const updateStatus = (data = {}) => {
	return post('/api/oms/mallshopaccount/updateStatus', {
		data,
	})
}
// 根据id获取子账号详情
export const getShopAccountDetail = (params = {}) => {
	const id = params.id
	delete params.id
	return get('api/oms/mallshopaccount/' + id, {
		params,
	})
}
// 修改-子账号
export const editShopAccountDetail = (data = {}) => {
	return post('/api/oms/mallshopaccount/update', {
		data,
	})
}
// 新增-子账号
export const addShopAccountDetail = (data = {}) => {
	return post('/api/oms/mallshopaccount/save', {
		data,
	})
}

// 注册
export const addRegedit = (data = {}) => {
	return post('/api/oms/mallshopaccount/regedit', {
		data,
	})
}

// 认证
export const updateAuthentication = (data = {}) => {
	return post('/api/updateAuthentication', {
		data,
	})
}

// 修改用户信息
export const updateShopInfo = (data = {}) => {
	return post('/api/oms/mallshopaccount/updateShop', {
		data,
	})
}

